import request from "@/utils/request.ts";
import {DeleteByIdRes, QueryParams, QueryRes, SaveParams, SaveRes} from "@/api/base/seat/type.ts";

/**
 * save
 * @param {object} params TrainSeatSaveReq
 * @param {number} params.id
 * @param {string} params.trainCode
 * @param {number} params.carriageIndex
 * @param {string} params.row
 * @param {string} params.col
 * @param {string} params.seatType
 * @param {number} params.carriageSeatIndex
 * @param {object} params.createTime
 * @param {object} params.updateTime
 * @returns
 */
export function save(params: SaveParams): Promise<SaveRes> {
    return request.post(`/business/admin/trainSeat/save`, params);
}


/**
 * query
 * @param {object} params TrainSeatQueryReq
 * @param {number} params.pageNum
 * @param {number} params.pageSize
 * @returns
 */
export function query(params: QueryParams): Promise<QueryRes> {
    return request.post(`/business/admin/trainSeat/quest-list`, params);
}

/**
 * deleteById
 * @param {string} id
 * @returns
 */
export function deleteById(id: number): Promise<DeleteByIdRes> {
    return request.delete(`/business/admin/trainSeat/delete/${id}`);
}